using System;

namespace Devsoft.Utilities
{
	/// <summary>
	/// Summary description for DictEntry.
	/// </summary>
	public class DictEntry
	{
		private int _nOffest = 0;
		private int _nLength = 0;
		private String _sWord = String.Empty;

		public String Word
		{
			set
			{
				_sWord = value;
			}
			get
			{
				return _sWord;
			}
		}

		public int Offset
		{
			set
			{
				_nOffest = value;
			}
			get
			{
				return _nOffest;
			}
		}

		public int Length
		{
			set
			{
				_nLength = Length;
			}
			get
			{
				return _nLength;
			}
		}

		public DictEntry()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		

		public DictEntry(String aEntryDefiniton)
		{
			int pos = aEntryDefiniton.IndexOf('\t');
            if (pos > -1)
            {
				_sWord = aEntryDefiniton.Substring(0,pos).Trim();
				aEntryDefiniton = aEntryDefiniton.Substring(pos + 1).Trim();
				pos = aEntryDefiniton.IndexOf('\t');
				if (pos > -1)
				{
					_nOffest = 0; // System.Convert.ToInt32(aEntryDefiniton.Substring(0, pos).Trim());
					_nLength = 0; // System.Convert.ToInt32(aEntryDefiniton.Substring(pos + 1).Trim());					
				}//End If

            }//End If
		}

		public DictEntry(String aWord,int aOffest, int aLength)
		{
			_sWord = aWord;
			_nLength = aLength;
			_nOffest = aOffest;
		}

	
		public override string ToString()
		{
			// TODO:  Add DictEntry.ToString implementation
			return _sWord;
		}
	}
}
